Use projmanag
Go

--User
insert into [user] (user_email, user_password, user_firstname, user_lastname, user_birthday, 
						  user_sex, user_phone, user_address)
		values ('khanh@gmail.com', '123456', 'khanh', 'nguyen', '03/14/1989', 1, '123456789', 'khanh address') 
insert into [user] (user_email, user_password, user_firstname, user_lastname, user_birthday, 
						  user_sex, user_phone, user_address)
		values ('longheo@gmail.com', '123456', 'longheo', 'nguyen', '01/09/1v989', 1, '987654321', 'longheo address')
insert into [user] (user_email, user_password, user_firstname, user_lastname, user_birthday, 
						  user_sex, user_phone, user_address)
		values ('nam@gmail.com', '123456', 'nam', 'vu', '02/06/1989', 1, '111222333', 'nam address')
insert into [user] (user_email, user_password, user_firstname, user_lastname, user_birthday, 
						  user_sex, user_phone, user_address)
		values ('longphi@gmail.com', '123456', 'longphi', 'nguyen', '01/12/1989', 1, '999888777', 'longphi address')
insert into [user] (user_email, user_password, user_firstname, user_lastname, user_birthday, 
						  user_sex, user_phone, user_address)
		values ('thao@gmail.com', '123456', 'thao', 'nguyen', '03/05/1989', 0, '666777888', 'thao address')

SELECT * FROM [user]

insert into [project] (manager_id, project_name, project_description, project_start_date, project_end_date)
		values ('0','Tim Thong','Produce milk', '01/01/2010', '03/01/2010')

insert into [project] (manager_id, project_name, project_description, project_start_date, project_end_date)
		values ('1','Trai Heo Giong','Chan nuoi heo cung cap cho cac tinh vung sau vung xa', '01/02/2010', '03/02/2010')

insert into [project] (manager_id, project_name, project_description, project_start_date, project_end_date)
		values ('2','Quan Lot Khe','Co dong toan dan mac quan lot khe ', '01/03/2010', '03/03/2010')

select * from [project]

insert into [milestone] (project_id, milestone_name, milestone_description, milestone_start_date, milestone_end_date)
		values ('0','Found milk','Prepare ingredients to produce milk', '01/01/2010', '02/01/2010')
insert into [milestone] (project_id, milestone_name, milestone_description, milestone_start_date, milestone_end_date)
		values ('0','Produce milk','producing milk', '02/02/2010', '03/01/2010')
insert into [milestone] (project_id, milestone_name, milestone_description, milestone_start_date, milestone_end_date)
		values ('1','Nuoi heo','Nuoi heo cho map ra', '01/02/2010', '03/02/2010')
insert into [milestone] (project_id, milestone_name, milestone_description, milestone_start_date, milestone_end_date)
		values ('1','Van chuyen heo','Phan phoi heo', '02/03/2010', '02/02/2010')
insert into [milestone] (project_id, milestone_name, milestone_description, milestone_start_date, milestone_end_date)
		values ('2','Thuyet phuc','Thuyet phuc moi nguoi bang cach mac quan lot khe chay vong vong', '01/03/2010', '02/03/2010')
insert into [milestone] (project_id, milestone_name, milestone_description, milestone_start_date, milestone_end_date)
		values ('2','Phan phoi','Phat quan mien phi cho moi nguoi', '02/04/2010', '03/03/2010')
select * from milestone
update milestone set milestone_end_date = '02/02/2010' where milestone_id = 1
update milestone set milestone_end_date = '03/02/2010' where milestone_id = 4

insert into [work_on] values ('3', '0', 'TEAMLEAD')
insert into [work_on] values ('4', '0', 'DEVELOPER')
insert into [work_on] values ('1', '0', 'TESTER')
insert into [work_on] values ('2', '0', 'OBSERVER')

insert into [work_on] values ('0', '1', 'TEAMLEAD')
insert into [work_on] values ('2', '1', 'DEVELOPER')
insert into [work_on] values ('3', '1', 'TESTER')
insert into [work_on] values ('4', '1', 'OBSERVER')

insert into [work_on] values ('1', '2', 'TEAMLEAD')
insert into [work_on] values ('0', '2', 'DEVELOPER')
insert into [work_on] values ('4', '2', 'TESTER')
insert into [work_on] values ('3', '2', 'OBSERVER')

select * from [work_on]

insert into [phase] (milestone_id, phase_name, phase_description, phase_start_date, phase_end_date)
		values ('1','Mua thuc an','Tim mua thuc an cho heo', '01/02/2010','01/10/2010')

insert into [phase] (milestone_id, phase_name, phase_description, phase_start_date, phase_end_date)
		values ('1','Mua heo','Tim mua heo giong', '01/10/2010','02/02/2010')

insert into [phase] (milestone_id, phase_name, phase_description, phase_start_date, phase_end_date)
		values ('4','van chuyen','van chuyen heo', '02/03/2010','03/02/2010')

insert into [phase] (milestone_id, phase_name, phase_description, phase_start_date, phase_end_date)
		values ('0','tim nguyen lieu','tim nguyen lieu de san xuat', '01/01/2010','02/01/2010')

insert into [phase] (milestone_id, phase_name, phase_description, phase_start_date, phase_end_date)
		values ('5','tron nguyen lieu','tron cac nguyen lieu lai', '02/02/2010','02/15/2010')

insert into [phase] (milestone_id, phase_name, phase_description, phase_start_date, phase_end_date)
		values ('5','dong hop','cho sua vao hop', '02/16/2010','03/01/2010')


insert into [phase] (milestone_id, phase_name, phase_description, phase_start_date, phase_end_date)
		values ('2','tuyen nguoi','tuyen nguoi tinh nguyen', '01/03/2010','01/15/2010')

insert into [phase] (milestone_id, phase_name, phase_description, phase_start_date, phase_end_date)
		values ('2','huan luyen','huan luyen tinh nguyen vien', '01/16/2010','02/03/2010')

insert into [phase] (milestone_id, phase_name, phase_description, phase_start_date, phase_end_date)
		values ('3','mua quan','mua 1 dong quan', '02/04/2010','02/15/2010')

insert into [phase] (milestone_id, phase_name, phase_description, phase_start_date, phase_end_date)
		values ('3','phat quan','phat quan mien phi cho moi nguoi', '02/16/2010','03/03/2010')
select * from phase

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('0', 'mua cam heo','01/02/2010', '01/05/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('0', 'mua thuoc bo','01/06/2010', '01/10/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('1', 'mua heo','01/10/2010', '02/02/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('2', 'van chuyen toi vung sau','02/03/2010', '02/15/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('2', 'van chuyen toi vung xa','02/16/2010', '03/02/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('3', 'mua duong','01/01/2010', '01/15/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('3', 'mua sua','01/16/2010', '02/01/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('4', 'tron sua va duong','02/02/2010', '02/15/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('5', 'dong hop','02/16/2010', '03/01/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('6', 'tuyen nam','01/03/2010', '01/10/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('6', 'tuyen gay','01/11/2010', '01/15/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('7', 'huan luyen','01/16/2010', '02/03/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('8', 'mua quan 1','02/04/2010', '02/08/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('8', 'mua quan 2','02/09/2010', '02/15/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('9', 'phat o thanh pho','02/16/2010', '02/20/2010')

insert into [task] (phase_id, task_name,task_start_date, task_end_date)
		values ('9', 'phat o cac tinh','02/21/2010', '03/03/2010')
select * from task

insert into assign values ('0', '0')
insert into assign values ('2', '1')
insert into assign values ('3', '2')
insert into assign values ('0', '3')
insert into assign values ('2', '4')
insert into assign values ('4', '5')
insert into assign values ('3', '6')
insert into assign values ('1', '7')
insert into assign values ('4', '8')
insert into assign values ('0', '9')
insert into assign values ('0', '10')
insert into assign values ('4', '11')
insert into assign values ('1', '12')
insert into assign values ('0', '13')
insert into assign values ('1', '14')
insert into assign values ('4', '15')

select * from assign